$(document).ready(function(){
	if($("#type").val()==2){
		$("#personal").hide();
		$("#firm").show();
		$("#personalData").hide();
		$("#firmData").show();
	}
	var authentication=$("#renzheng").val();//认证状态
	var license=$("#zhizhao").val();
	var id=$("#mingpian").val();
	var idfront=$("#shenzheng").val();
	var idopposite=$("#shenbei").val();
	var scale=$("#guimo").val();
	//营业执照数据回填
	if(license!=''){
		$("#licensediv").append("<div class='images'>"
				+ "<div class='imgbox'><span>"
				+ "<img   onclick='javascript:parent.openImg(\""
				+ FILESERVER_PATH
				+ "\",\""
				+ license
				+ "\")' src=\""
				+ FILESERVER_PATH
				+ "?id="
				+ license
				+ "\"/><input type='hidden' id='license' name='license' value='"
				+ license
				+ "'></span>"
				+ "</div>");
	}
	//名片数据回填
	if(id!=''){
		$("#iddiv").append("<div class='images'>"
				+ "<div class='imgbox'><span>"
				+ "<img   onclick='javascript:parent.openImg(\""
				+ FILESERVER_PATH
				+ "\",\""
				+ id
				+ "\")' src=\""
				+ FILESERVER_PATH
				+ "?id="
				+ id
				+ "\"/><input type='hidden' id='license' name='license' value='"
				+ id
				+ "'></span>"
				+ "</div>");
	}
	//身份证正面数据回填
	if(idfront!=''){
		$("#idfdiv").append("<div class='images'>"
				+ "<div class='imgbox'><span>"
				+ "<img   onclick='javascript:parent.openImg(\""
				+ FILESERVER_PATH
				+ "\",\""
				+ idfront
				+ "\")' src=\""
				+ FILESERVER_PATH
				+ "?id="
				+ idfront
				+ "\"/><input type='hidden' id='idfront' name='idfront' value='"
				+ idfront
				+ "'></span>"
				+ "</div>");
	}
	if(idopposite!=''){
		$("#idodiv").append("<div class='images'>"
				+ "<div class='imgbox'><span>"
				+ "<img   onclick='javascript:parent.openImg(\""
				+ FILESERVER_PATH
				+ "\",\""
				+ idopposite
				+ "\")' src=\""
				+ FILESERVER_PATH
				+ "?id="
				+ idopposite
				+ "\"/><input type='hidden' id='idopposite' name='idopposite' value='"
				+ idopposite
				+ "'></span>"
				+ "</div>");
	}
	
	if(scale==''){
		$("#0").attr("selected","selected");
	}else if(scale==1){
		$("#1").attr("selected","selected");
	}else if(scale==2){
		$("#2").attr("selected","selected");
	}else if(scale==3){
		$("#3").attr("selected","selected");
	}else if(scale==4){
		$("#4").attr("selected","selected");
	}else if(scale==5){
		$("#5").attr("selected","selected");
	}
	
	if(authentication==3){
		$("#establishmentDate").attr("disabled","disabled");
		$("#scale").attr("disabled","disabled");
		$("#licenseFile").attr("disabled","disabled");
		$("#idFile").attr("disabled","disabled");
		$("#idfFile").attr("disabled","disabled");
		$("#idoFile").attr("disabled","disabled");
		$("#personalsubmit").attr("disabled","disabled");
		$("#firmsubmit").attr("disabled","disabled");
		$("#firmname").attr("readonly","readonly");
		$("#firmaddr").attr("readonly","readonly");
		$("#contacts").attr("readonly","readonly");
		$("#fixedtel").attr("readonly","readonly");
		$("#name").attr("readonly","readonly");
		$("#company").attr("readonly","readonly");
		$("#studioaddr").attr("readonly","readonly");
		$("#works1").attr("readonly","readonly");
		$("#works2").attr("readonly","readonly");
		$("#works3").attr("readonly","readonly");
		$("#error2").css("display","block");
		$("#errorContent2").text("审核过程中：您的认证资料已提交，请耐心等待审核结果！");
	}else if(authentication==1){
		$("#error2").css("display","block");
		$("#errorContent2").text("审核通过：您已经通过审核！");
	}else if(authentication==2){
		$("#error2").css("display","block");
		$("#errorContent2").text("审核没通过：您的资料没有认证通过（审核意见），请重新提交！");
	}else{
		$("#errorContent2").text("");
	}
	submitConfirm();//认证资料提交申请(个人)
	firmSubmit();//认证资料提交申请(企业)
});